/**
 * 
 */
package com.eascs.crm.nsEditDetail.service.impl;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.eascs.crm.nsEditDetail.dao.MainMonthInfoDao;
import com.eascs.crm.nsEditDetail.entity.O2oMainMonthInfoEntity;
import com.eascs.crm.nsEditDetail.service.IMainMonthInfoService;

/**@Description:
 *               <p>
 *               实现近六个月营业额情况接口
 *               </p>
 * @author LMX
 */
@Service
public class MainMonthInfoServiceImpl implements IMainMonthInfoService{

	@Autowired
	MainMonthInfoDao mainMonthInfoDao;

	/**
	 * @Description:
	 *               <p>
	 *               根据id查询实体
	 *               </p>
	 * @author LMX
	 */
	@Override
	public O2oMainMonthInfoEntity getEntityById(String id) {
		return mainMonthInfoDao.getById(O2oMainMonthInfoEntity.class, id);
	}

	/**
	 * @Description:
	 *               <p>
	 *                保存修改
	 *               </p>
	 * @author LMX
	 */
	@Override
	public boolean update(O2oMainMonthInfoEntity info) {
		return mainMonthInfoDao.updateById(info) > 0;
	}

	/**
	 * @Description:
	 *               <p>
	 *                新增
	 *               </p>
	 * @author LMX
	 */
	@Override
	public boolean insert(O2oMainMonthInfoEntity info) {
		return mainMonthInfoDao.insert(info) > 0;
	}

	/**@Description:
	 *               <p>
	 *               根据loanapplyNo查询
	 *               </p>
	 * @author LMX
	 */
	@Override
	public O2oMainMonthInfoEntity getByLoanNo(String loanapplyNo) {
		String sql = "SELECT * from o2o_main_month_info t where t.loanapply_no = ?";
		return mainMonthInfoDao.findEntity(sql, O2oMainMonthInfoEntity.class, loanapplyNo);
	}

}
